# Contributor: John Regan <john@jrjrtech.com>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=s6-dns
pkgver=2.4.0.0
pkgrel=0
pkgdesc="skarnet.org's DNS client libraries and command-line DNS client utilities"
url=https://skarnet.org/software/s6-dns/
arch="all"
license="ISC"
options="!check"
_skalibs_version=2.14.3
makedepends="skalibs-dev>=${_skalibs_version}"
subpackages="$pkgname-static $pkgname-libs $pkgname-dev $pkgname-doc"
source="https://skarnet.org/software/s6-dns/s6-dns-$pkgver.tar.gz s6-dns.pc.in"

build() {
	./configure \
		--enable-shared \
		--disable-allstatic \
		--prefix=/usr \
		--libexecdir="/usr/lib/$pkgname"
	make
}

package() {
	make DESTDIR="$pkgdir" install
	sed -e "s/@@VERSION@@/$pkgver/g; s/@@SKALIBS_VERSION@@/${_skalibs_version}/g;" "$srcdir/$pkgname.pc.in" > "$srcdir/$pkgname.pc"
	install -D -m 0644 "$srcdir/$pkgname.pc" "$pkgdir/usr/lib/pkgconfig/$pkgname.pc"
	mkdir -p "$pkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname"
}

sha512sums="
6c9eb8ad4501ac20733747ae0065ed1d19abd2c61e29e98fc6d0421367ec9ece951daea287e4ec8c4301a74b6f96b8a0e376b4b3ba046cca515b8b57d69600e2  s6-dns-2.4.0.0.tar.gz
fd93571da2d2a6c2dea00219414f9ee5fe3bc09a4a6a7fd002b9251c22ff682eddfeff4bf9c6c90d8b02681fc8117328a1fd9689839ab457d354870c522bf5e7  s6-dns.pc.in
"
